Add render_graph for spatial connectivity visualization#592
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #592 +/- ##
==========================================
+ Coverage 77.07% 77.47% +0.39%
==========================================
Files 11 11
Lines 3280 3569 +289
Branches 774 837 +63
==========================================
+ Hits 2528 2765 +237
- Misses 454 481 +27
- Partials 298 323 +25
🚀 New features to boost your workflow:
|
33e1d4c to
96b07df
Compare
Adds sdata.pl.render_graph() to draw spatial graph edges from adjacency matrices stored in table.obsp, using element centroids as node positions. Supports shapes, points, and labels. Features: - Scalar / obs-categorical / obs-continuous / obsp-matrix edge coloring - Per-edge widths and alphas (scalar or from a weight matrix) - Group filtering (both endpoints must be in the requested groups) - Self-loop rendering as a CircleCollection - Integrated colorbar via the existing ColorbarSpec pipeline - Legend sharing with chained render_shapes / render_points - No new dependencies (no networkx)
96b07df to
35ee4ce
Compare
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sdata.pl.render_graph()to render spatial graph edges from adjacency matrices stored intable.obsp, using element centroids for coordinates viaspatialdata.get_centroids()groups+group_keyfiltering (both-endpoints semantics) and auto-discovery of element/table when unambiguousAPI
Implementation details
connectivity_keyaccepts full obsp key or prefix (auto-resolves"spatial"→"spatial_connectivities")LineCollection